class Solution:
    def minArray(self, numbers: list) -> int:
        if len(numbers) == 0: return False

        i, j = 0, len(numbers) - 1
        while i < j:
            tmp = (i + j) // 2
            if numbers[tmp] > numbers[j]:
                i = tmp + 1
            elif numbers[tmp] < numbers[j]:
                j = tmp
            else:
                j -= 1

        return numbers[i]
                

if __name__ == '__main__':
    solution = Solution()
    numbers = [3,4,5,1,2]
    print(f"Min: {solution.minArray(numbers)}")

    numbers = [2,2,2,0,1]
    print(f"Min: {solution.minArray(numbers)}")

            